package com.id.supaclean.ui.game

import android.os.Bundle
import android.view.View
import android.widget.ImageView
import androidx.core.os.bundleOf
import androidx.lifecycle.lifecycleScope

import com.id.supaclean.R
import com.id.supaclean.common.BaseFragment
import kotlinx.coroutines.delay


/**
 * Created by YiGo on 2022/6/14.
 */
class GameBoostFragment:BaseFragment() {
    override fun layoutId(): Int = R.layout.fragment_game_boost

    override fun initView() {
        super.initView()
        view?.findViewById<ImageView>(R.id.game_boost_fragment_back_iv)?.setOnClickListener {
            navigate(R.id.action_gameBoostFragment_to_finishFragment)
        }
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        lifecycleScope.launchWhenResumed {
            val cleanNum = arguments?.getString("clean_num")
            val bundle = bundleOf("clean_num" to cleanNum)
            delay(3000)
            navigate(R.id.action_gameBoostFragment_to_finishFragment,bundle)
        }
    }
}